import request from '@/utils/request'
import { autograph } from '@/utils/autograph'

// 获取管理员列表
export function adminList(query) {
  const url = '/admin/index'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 获取职务列表
export function getDuties(query) {
  const url = '/admin/getDuties'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 添加管理员
export function createAdmin(query) {
  const url = '/admin/store'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 编辑管理员
export function updateAdmin(query) {
  const url = '/admin/update'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 删除管理员
export function deleteAdmin(query) {
  const url = '/admin/update'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 修改状态
export function changeStatus(query) {
  const url = '/admin/changeStatus'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 修改修改密码
export function changeNewPassword(query) {
  const url = '/xin/changeNewPassword'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 获取首页统计数据
export function indexCount(query) {
  const url = '/xin/indexCount'
  const data = autograph(url, query)
  return request({
    url: url,
    method: 'post',
    data
  })
}

